home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / tcxl551.arc / TCXL_INC.EXE / lha / INC / TCXLMOU.H < prev    next >
Text File  |  1990-10-01  |  6KB  |  112 lines

  1. /*=====[ The TesSeRact(TM) CXL User Interface Development System ]======*
  2.  | Copyright (c) 1987-1990, Innovative Data Concepts. All Rights Reserved
  3.  |
  4.  | This Library is part of IDC's TesSeRact Development Tools product
  5.  | line. For information about other IDC products, call 1-215-884-3373.
  6.  *----------------------------------------------------------------------*
  7.  | <TCXLmou.h> : Definitions and prototypes for TCXL Microsoft-compatible
  8.  | mouse functions.
  9.  *-------------------------------[ Notes ]------------------------------*
  10.  | 1) All mouse positions are in terms of text rows and columns.
  11.  | 2) MSinit() and MSterm() MUST not be called by user code.  They are
  12.  |    called by the TCXL initialization and termination functions.
  13.  | 3) MSpush() and MSpop() position the mouse cursor.
  14.  *----------------------------------------------------------------------*
  15.  | PGS : $Id: tcxlmou.h 5.51 90/10/01 00:00:00 MLM Release Locker: MLM $
  16.  | $Log:    tcxlmou.h $
  17.  | Revision 5.51  90/10/01  00:00:00  MLM
  18.  | TCXL 5.51
  19.  | 
  20.  *======================================================================*/
  21. #ifndef  _TCXLmou_
  22. #  define   _TCXLmou_ 1
  23. #  ifndef   _TCXLkey_
  24. #     include  <TCXLkey.h>
  25. #  endif
  26.                         /*- support level ------*/
  27. #define  MOU_NONE 0x00  /* no mouse support     */
  28. #define  MOU_KEYS 0x01  /* emulate arrow keys   */
  29. #define  MOU_CURS 0x02  /* free-moving cursor   */
  30. #define  MOU_FULL 0x03  /* full mouse support   */
  31.                         /*- global flags -------*/
  32. #define  MOU_INIT 0x80  /* mouse initialized    */
  33. #define  MOU_3BTN 0x40  /* 3-button mouse       */
  34.  
  35. /*------------------[ Data objects and access macros ]------------------*/
  36.  
  37. TYP   struct   Mou   MouT;    /*- mouse-control object -----*/
  38. struct   Mou                  /* 00 *- 16-level stack ------*/
  39. {  BytT  mlvl;                /* 00 : head support-level    */
  40.    BytT  mcol;                /* 01 : head text column      */
  41.    BytT  mrow;                /* 02 : head text row         */
  42.    BytT  mstk[45];            /*    *-----------------------*/
  43.    BytT  mflg;                /* 30 : global flags          */
  44.    BytT  mbtn;                /* 31 : button-status         */
  45.    IntT  mcnt;                /* 32 : button-count          */
  46.    IntT  mhor;                /* 34 : horizontal motion     */
  47.    IntT  mver;                /* 36 : vertical motion       */
  48.    KeyT  mlkc;                /* 38 : left-button keycode   */
  49.    KeyT  mrkc;                /* 3A : right-button keycode  */
  50.    KeyT  mmkc;                /* 3C : middle-button keycode */
  51.    WrdT  mfut;                /* 3E : reserved for future   */
  52. };                            /* 40 ]-----------------------*/
  53.  
  54. GBL   MouT  CDC   _MouCtl; /*- global mouse-control object ----*/
  55. #define  MouLvl   (_MouCtl.mlvl)             /* head level     */
  56. #define  MouNone  (0 == (MouLvl & MOU_FULL)) /*    support off */
  57. #define  MouKeys  (0 != (MouLvl & MOU_KEYS)) /*    arrow       */
  58. #define  MouCurs  (0 != (MouLvl & MOU_CURS)) /*    free        */
  59. #define  MouFull  (0 != (MouLvl & MOU_FULL)) /*    full        */
  60. #define  MouCol   (_MouCtl.mcol)             /* head column    */
  61. #define  MouRow   (_MouCtl.mrow)             /* head row       */
  62. #define  MouFlg   (_MouCtl.mflg)             /* global flags   */
  63. #define  MouInit  (0 != (MouFlg & MOU_INIT)) /*    initialized */
  64. #define  Mou3btn  (0 != (MouFlg & MOU_3BTN)) /*    3-button    */
  65. #define  MouBtn   (_MouCtl.mbtn)             /* button-status  */
  66. #define  MouLeft  (0 != MouBtn & 0x01)       /*    left        */
  67. #define  MouRght  (0 != MouBtn & 0x02)       /*    right       */
  68. #define  MouCent  (0 != MouBtn & 0x04)       /*    center      */
  69. #define  MouCnt   (_MouCtl.mcnt)             /* button-count   */
  70. #define  MouHor   (_MouCtl.mhor)             /* horiz. motion  */
  71. #define  MouVer   (_MouCtl.mver)             /* vert. motion   */
  72. #define  MouLkey  (_MouCtl.mlkc)             /* left keycode   */
  73. #define  MouRkey  (_MouCtl.mrkc)             /* right keycode  */
  74. #define  MouMkey  (_MouCtl.mmkc)             /* middle keycode */
  75.  
  76. /*-------------------------[ function prototypes ]----------------------*/
  77.  
  78. #ifdef __cplusplus            /* no mangling, please */
  79.    extern "C" {
  80. #endif
  81. VOID  PAS   _MSget(NOARG);             /* Internal                      */
  82. VOID  PAS   _MSpos(NOARG);             /* Internal                      */
  83. VOID  PAS   _MSset(NOARG);             /* Internal                      */
  84. VOID  PAS   _MSsho(IntT s);            /* Internal                      */
  85. VOID  PAS   MSclear(NOARG);            /* Clear button counts           */
  86. VOID  PAS   MScurs(WrdT t, WrdT s,     /* Set text cursor               */
  87.    WrdT c);
  88. VOID  PAS   MSgoto(IntT r, IntT c);    /* Put cursor                    */
  89. VOID  PAS   MShide(NOARG);             /* Hide cursor                   */
  90. VOID  PAS   MShome(NOARG);             /* Home cursor, clear counts     */
  91. IntT  PAS   MSinit(NOARG);             /* Intitialize mouse-support     */
  92. VOID  PAS   MSkeys(KeyT l, KeyT r,     /* Assign left, right, middle    */
  93.    KeyT m);                            /*    button keycodes            */
  94. VOID  PAS   MSlimit(IntT sr, IntT sc,  /* Set screen limits             */
  95.    IntT er, IntT ec);
  96. VOID  PAS   MSmove(NOARG);             /* Get mouse motion              */
  97. VOID  PAS   MSpop(NOARG);              /* Pop state off stack           */
  98. VOID  PAS   MSpress(IntT b);           /* Get button presses            */
  99. VOID  PAS   MSpush(IntT m);            /* Push state onto stack         */
  100. VOID  PAS   MSreles(IntT b);           /* Get button releases           */
  101. VOID        MSshow(NOARG);             /* Show cursor                   */
  102. VOID  PAS   MSspeed(IntT x, IntT y);   /* Set speed                     */
  103. VOID  PAS   MSstat(NOARG);             /* Get status                    */
  104. VOID  PAS   MSterm(NOARG);             /* Terminate mouse-support       */
  105. VOID  PAS   MSupdat(IntT sr, IntT sc,  /* Set conditional region        */
  106.    IntT er, IntT ec);
  107. #define  MSshow()    (_MSsho(0))
  108. #ifdef __cplusplus
  109.    }
  110. #endif
  111. #endif   /* _TCXLmou_ -- End of TCXLmou.h */
  112.